<!doctype html>
<html lang="en">
 <head>
 <meta charset="UTF-8">  
  <title>视频类别列表</title>
 </head>
 <body>
 <?php
  require_once('inc_admin.php');
  require_once('menu.php');
  connect();
  //编写sql语句
  $sql = 'select * from videotype';
  //echo $sql.'<br/>';  
  $result = fetch_array($sql); //包含多条记录的数组
 ?>
 <center><h3>视频类别列表</h3></center>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>编号</th>
   <th>类别名</th>   
   <th>操作</th>
 </tr>
 <?php
  foreach ($result as $row) {
	 echo '<tr>';
	 echo '<td>'.$row['tid'].'</td>';
	 echo '<td>'.$row['typename'].'</td>';	 
	
	 echo '<td><a href="vtForm.html">添加</a> 
   <a href="vteditform.php?id='.$row['tid'].' ">修改</a> | 
	 <a href="vtdelete.php?id='.$row['tid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
	 echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}条记录</td></tr></table>";   
 ?>
 </body>
</html>



